<?php 
	require_once("utils.php");
	require_once("obj/session.php");
	require_once("obj/user.php");
	$users = User::getAllUsers();
?>
<a href="<?php echo Utils::makeUserDetailUrl(0); ?>">New</a>
<table class="datatable" width="100%" cellpadding="5" cellspacing="0">
<tr><th>Email</th><th>Created</th><th>Modified</th><th>&nbsp;</th></tr>
<?php
	$ix = 0;
	foreach($users as $u){
		$i = $u->UserId; 
		$e = $u->Email;
		$c = $u->createdStr(FALSE);
		$m = $u->modifiedStr(FALSE);
		$u = Utils::makeUserDetailUrl($i);
		$cs = $ix % 2 == 0 ? "row" : "altrow";
		echo "<tr class=\"$cs\"><td><a href=\"mailto:$e\">$e</a></td><td>$c</td><td>$m</td><td><a href=\"$u\">Edit</a></td></tr>";
		$ix++;
	}
?>
</table>
<?php echo count($users)." rows"; ?>